private import base;
  contract updateable over %r determines %t is {
  _extend has type (%r,%t)=>%r;
  _merge has type (%r, %r) => %r;
  _delete has type (%r, ()<=%t) => %r;
  _update has type (%r, ()<=%t, (%t)=>%t) => %r;
}

-- Update sub-language
# update ?Ptn in ?Tgt with ?Exp :: action :- Ptn::pattern :& Tgt::lvalue :& Exp::expression;
# delete ?Ptn in ?Tgt :: action :- Ptn::pattern :& Tgt::expression;
# extend ?Tgt with ?Exp :: action :- Tgt::lvalue :& Exp::expression;
# merge ?Tgt with ?Exp :: action :- Tgt::lvalue :& Exp::expression;

# extend ?Tgt with ?Exp ==> Tgt := _extend(Tgt,Exp);
# merge ?Tgt with ?Exp ==> Tgt := _merge(Tgt, Exp);
# delete ?Ptn in ?Tgt ==> Tgt := _delete(Tgt, (pattern() from Ptn));
# update ?Ptn in ?Tgt with ?Exp ==> Tgt := _update(Tgt, (pattern() from Ptn), (function(Ptn) is Exp));
